import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '门牌号',
    align:"center",
    dataIndex: 'houseNo'
   },
   {
    title: '面积',
    align:"center",
    dataIndex: 'areaMeasure'
   },
   {
    title: '收房日期',
    align:"center",
    dataIndex: 'checkinDate'
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'state'
   },
   {
    title: '户主',
    align:"center",
    dataIndex: 'holder'
   },
   {
    title: '联系电话',
    align:"center",
    dataIndex: 'mobile'
   },
   {
    title: '小区id',
    align:"center",
    dataIndex: 'villageId_dictText'
   },
   {
    title: '楼栋id',
    align:"center",
    dataIndex: 'buildindId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '门牌号',
    field: 'houseNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入门牌号!'},
          ];
     },
  },
  {
    label: '面积',
    field: 'areaMeasure',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入面积!'},
          ];
     },
  },
  {
    label: '收房日期',
    field: 'checkinDate',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'state',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入状态!'},
          ];
     },
  },
  {
    label: '户主',
    field: 'holder',
    component: 'Input',
  },
  {
    label: '联系电话',
    field: 'mobile',
    component: 'Input',
  },
  {
    label: '小区id',
    field: 'villageId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"property_village,name,id"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入小区id!'},
          ];
     },
  },
  {
    label: '楼栋id',
    field: 'buildindId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"property_building,name,id"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入楼栋id!'},
          ];
     },
  },
];
